package com.ligongmusic.view;


import android.view.View;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Created by Administrator on 2016/8/25.
 */
public abstract class FlowAdapter<T> {
    private List<T> mDatas;

    public FlowAdapter(List<T> datas) {
        this.mDatas = datas;
    }

    public FlowAdapter(T[] array) {
        this.mDatas = new ArrayList<T>(Arrays.asList(array));
    }

    public int getCount() {
        return mDatas == null ? 0 : mDatas.size();
    }

    public T getItem(int position) {
        return mDatas.get(position);
    }

    public abstract View getView(FlowLayout parent, int position, T t);

}
